import serve from './index'
// 按需导出

// 获取页码数
export function getPages(departmentName, name) {
    return serve({
        url: '/admin/teacher/page/count',
        method: 'get',
        params: {
            departmentName: departmentName,
            name: name,
        }
    })
}

// 搜索
export function getList(page, departmentName, name) {
    return serve({
        url: '/admin/teacher/page/' + page,
        method: 'get',
        params: {
            departmentName: departmentName,
            name: name,
        }
    })
}

// 搜索所有系
export function getListAll() {
    return serve({
        url: '/admin/department/names',
        method: 'get',
    })
}

// 查询当前老师
export function getTeacher(page,number, name, departmentId, password,id) {
    return serve({
        url: '/admin/teacher/'+page,
        method: 'get',
        data: {
            number: number,
            name: name,
            departmentId: departmentId,
            id: id,
            password: password
        }
    })
}

// 添加
export function ADDList(number, name, departmentId, password) {
    return serve({
        url: '/admin/teacher',
        method: 'post',
        data: {
            number: number,
            name: name,
            departmentId: departmentId,
            id: -1,
            password: password
        }
    })
}

// 更改
export function changeorno(departmentId, id,name,number,password) {
    return serve({
        url: '/admin/teacher',
        method: 'put',
        data: {
            departmentId:departmentId,
            number:number,
            password:password,
            name: name,
            id: id
        }
    })
}

// 删除
export function deleted(id) {
    return serve({
        url: '/admin/teacher/' + id,
        method: 'delete',
    })
}